import {axios} from './request.js'

// method, //请求方法
//header,  //请求头

//获取首页轮播图
export const getbanner =({data})=>{
	return axios({
		url:'/prod-api/api/rotation/list',
		data
	})
}

//获取全部服务
export const getallser =({data})=>{
	return axios({
		url:'/prod-api/api/service/list',
		data
	})
	
}

//获取新闻内容
export const getnew =({data})=>{
	return axios({
		url:'/prod-api/press/category/list',
		data
	})
}

//获取新闻列表
export const getnewlist =({data})=>{
	return axios ({
		url:'/prod-api/press/press/list',
		data
	})
}

//获取新闻详情
export const getnewdeta=({id})=>{
	return axios({
		url:'/prod-api/press/press/'+id,
		data:{}
	})
}

//给新闻点赞
export const tolike=({id,header,data})=>{
	return axios({
		url:'/prod-api/press/press/like/'+id,
		method:'put',
		header,
		data
	})
}

//获取新闻评论列表
export const getcomments=({data})=>{
	return axios({
		url:'/prod-api/press/comments/list',
		data
	})
}

//评论点赞
export const topressComment=({id,header})=>{
	return axios({
		url:'/prod-api/press/pressComment/like/'+id,
		method:'put',
		header,
		data:{}
	})
}

//发布新闻评论
export const tosendcom=({data,header})=>{
	return axios({
		url:'/prod-api/press/pressComment',
		method:'post',
		header,
		data,
	})
}